package com.ym.domain.model;

import com.baomidou.mybatisplus.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true)
public class BaseModel {

    @Column
    @TableId(type = IdType.ASSIGN_ID)
    @IsKey
    @EqualsAndHashCode.Include
    private Long id;

    @Column
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Column
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Column
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Boolean isDeleted;

}
